#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>

int main()
{
    char str1[10001] = { 0 };
    char str2[10001] = { 0 };
    int i = 0;
    do
    {
        scanf("%c", &str1[i++]);
    } while (str1[i - 1] != '\n');
    i = 0;
    do
    {
        scanf("%c", &str2[i++]);
    } while (str2[i - 1] != '\n');
    int len1 = strlen(str1);
    int len2 = strlen(str2);
    for (i = 0; i < len1 - 1; i++)
    {
        int flap = 1;
        for (int j = 0; j < len2 - 1; j++)
        {
            if (str1[i] == str2[j])
                flap = 0;
        }
        if (flap)
            printf("%c", str1[i]);
    }
    return 0;
}
#include<stdio.h>
#include<string.h>

int main()
{
    char str[10001] = { 0 };
    scanf("%s", str);
    int arr[4] = { 0 };
    char print[5] = "GPLT";
    int len = strlen(str);
    for (int i = 0; i < len; i++)
    {
        if (str[i] == 'G' || str[i] == 'g')
            arr[0]++;
        else if (str[i] == 'P' || str[i] == 'p')
            arr[1]++;
        else if (str[i] == 'L' || str[i] == 'l')
            arr[2]++;
        else if (str[i] == 'T' || str[i] == 't')
            arr[3]++;
    }
    int i = 0;
    while (arr[0] > 0 || arr[1] > 0 || arr[2] > 0 || arr[3] > 0)
    {
        if (arr[i] > 0 && 0 == i)
            printf("%c", print[0]);
        else if (arr[i] > 0 && 1 == i)
            printf("%c", print[1]);
        else if (arr[i] > 0 && 2 == i)
            printf("%c", print[2]);
        else if (arr[i] > 0 && 3 == i)
            printf("%c", print[3]);
        arr[i]--;
        i++;
        i %= 4;
    }
    return 0;
}